#ifndef __win_image_h__
#define __win_image_h__

#include "../core/define.h"
#include "../base/common.h"
#include "windefine.h"

#include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib")


class WinImage
{
public:
    WinImage();
    ~WinImage();

    BOOL Copy( WinImage &image );

    BOOL CreateFromImage( Gdiplus::Image * pImage );
    BOOL CreateDIBSection( int nWidth, int nHeight );
    BOOL DeleteObject();
    BOOL SetAlpha( BYTE byteAlpha, DWORD dwColor );

    BOOL TileBlt( HDC hDC, RECT rcDest, int nAlpha );
    BOOL GridBlt( HDC hDC, RECT rcDest, RECT rcGrid, int nLength, int nIndex, int nAlpha );

    operator HBITMAP(){ return m_hBitmap; }

private:
    int        m_nWidth;
    int        m_nHeight;
    HBITMAP    m_hBitmap;
    BYTE*      m_pBytes;

private:
    DISABLE_COPY_AND_ASSIGN(WinImage)
};

#endif